using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using TA.BE;

namespace HRM.Page
{
    public partial class EmployeeType : Form
    {
        public EmployeeType()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                _EMPLOYEE_TYPE emps = new _EMPLOYEE_TYPE();

                if (emps.LoadAll())
                {
                    DataView dv = new DataView();
                    dv = emps.DefaultView;

                    gridViewControl1.DataSource = dv.ToTable();
                    gridViewControl1.Show();
                    gridViewControl1.ArrayHeaderColumn = new string[] { "[NAME]", "[LASTNAME]" };
                    gridViewControl1.ShowEditColumn = true;
                    gridViewControl1.ShowDeleteColumn = true;

                    //gridViewControl1.DataBind();


                    dataGridView1.DataSource = dv.ToTable();

                }

                
                //bool loaded = employeeType.LoadAll();
                //gridViewControl1.DataSource = employeeType.DefaultView.Table;

                //if (employeeType.LoadByPrimaryKey(1))
                //{
                //    //employeeType.NAME = 
                //}


            }
            catch (Exception ex)
            {
                
            }
            
        }
    }
}